<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>我的资料</title>
    <link rel="stylesheet" href="__CDN__/assets/mobile/common/mobiscroll.2.13.2.css">
    <link rel="stylesheet" href="__CDN__/assets/mobile/common/mPicker.css">
    <link rel="stylesheet" href="__CDN__/assets/mobile/common/base.css">
    <link rel="stylesheet" href="__CDN__/assets/mobile/common/common.css">
    <link rel="stylesheet" href="__CDN__/assets/mobile/css/my-info.css">
</head>
<body>
        <header>
            <i class="go-back" onclick="javascript:history.go(-1);">
                <img src="__CDN__/assets/mobile/img/go-back.png" alt="">
            </i>
            <span class="keep">保存</span>
            <h1 class="perfect-title">我的资料</h1>
        </header>
        <div id="content">
            <ul class="info-list">
                <li>
                    <span>头像</span>
                    <img src="{$info['avatar']}" onclick="pic_heard.click()">
                    <input type="file" style="display:none" id="pic_heard">
                </li>
                <li>
                    <span>昵称</span>
                    <input type="text" value="{$info['nickname']}">
                </li>
                <li data-role="fieldcontain" class="demo-select">
                    <span>性别</span>
                    <select id="city" class="demo-test-select" data-role="none">
                        {if condition="$info['gender'] eq '1'"}
                        <option value="1"  selected="selected">男</option>
                        <option value="2">女</option>
                        {else /} other Framework
                        <option value="1">男</option>
                        <option value="2"  selected="selected">女</option>c
                        {/if}
                    </select>
                </li>
                <li>
                    <span>出生日期</span>
                    <input type="text" id="demo3" value="{$info['birthday']}">
                </li>
                <li>
                    <span>联系QQ</span>
                    <input type="text" value="{$info['qq']}">
                </li>
                <li>
                    <span>地区</span>
                    <input type="text" class="select-value" value="{$info['city_id']}">
                </li>
            </ul>
        </div>

</body>
<script type="text/javascript" src="__CDN__/assets/mobile/lib/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="__CDN__/assets/mobile/lib/vue.js"></script>
<script type="text/javascript" src="__CDN__/assets/mobile/lib/layer/layer.js"></script>
<script type="text/javascript" src="__CDN__/assets/mobile/lib/mobiscroll.2.13.2.js"></script>
 <script type="text/javascript" src="__CDN__/assets/mobile/common/common.js"></script>
<!-- <script type="text/javascript" src="__CDN__/assets/mobile/lib/opt.js"></script> -->
<script type="text/javascript" src="__CDN__/assets/mobile/lib/mPicker.js"></script>
<script>
        $('#pic_heard').on('change', function (e) {
            var fileObj = document.getElementById("pic_heard").files[0]; // js 获取文件对象
            console.log(fileObj);
            if (typeof (fileObj) == "undefined" && fileObj.size <= 0) {
                alert("请选择图片");
                return;
            }
            var formFile = new FormData();
            formFile.append("action", "UploadVMKImagePath");
            formFile.append("file", fileObj); //加入文件对象
            var data = formFile;
            $.ajax({
                url: "heardUpdate",
                data: data,
                type: "Post",
                dataType: "json",
                cache: false,//上传文件无需缓存
                processData: false,//用于对data参数进行序列化处理 这里必须false
                contentType: false, //必须
                success: function (result) {
                    console.log(12312312);
                    if (result.code==1) {
                        console.log(result);
                    }else{
                        layer.msg(result.msg);
                    }
                },
                error:function(result){
                    layer.msg('未知错误请重试！');
                }
            });
            
        });
    
</script>
</html>